package com.heima.admin.service;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class KafkaListeners {
    @Autowired
    private ApArticleAutoHandleService apArticleAutoHandleService;
    @KafkaListener(topics = {"news-id"})
    public void listener(ConsumerRecord<?,?> record){
        if (record!=null){
            //收到了信息
            String value = (String) record.value();

            apArticleAutoHandleService.autoReviewrticlesA(Integer.parseInt(value));
        }
    }


}
